package com.bankscene.screenfit.vus;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bankscene.screenfit.R;
import com.bankscene.screenfit.data.Menus;

public class MenusListItemVu implements Vu {

    View view;
    TextView titleView;
    ImageView iconImgsView;

    @Override
    public void init(LayoutInflater inflater, ViewGroup container) {
        view = inflater.inflate(R.layout.menus_list_item, container, false);
        iconImgsView = (ImageView) view.findViewById(R.id.icon);
        titleView = (TextView) view.findViewById(R.id.title);
    }

    @Override
    public View getView() {
        return view;
    }

    public void setTitle(String title){
        titleView.setText(title);
    }

    public void setVal(Menus val) {
        iconImgsView.setImageResource(val.getIcon());
        titleView.setText(val.getTitle());
    }
}
